Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Auto Reposition Frame for #821 #822

Closed
wants to merge 13 commits into from

Conversation

shenjackyuanjie
Copy link
Contributor

the Pull Request for #821

@shenjackyuanjie

This comment was marked as spam.

@benmoran56
Copy link
Member

Hi @shenjackyuanjie, sorry for the delay.

How about implementing this as a subclass of Frame? That way, the spacial hash can be used.

@shenjackyuanjie
Copy link
Contributor Author

How about implementing this as a subclass of Frame? That way, the spacial hash can be used.

Hmmmmm, I add the hash here just for indexing the widget/shape so that you can add/remove widget/shape with a hash, witch spacial hash are you talking about? if it is the hash used by Frame. I do not think it will have a good performance ( after all it will remove and add all the widget/shape when resizing)

I do think make this a subclass of Frame is a good idea, but it will require many modify in Frame class. sence the Frame have some unuse function for the reposition frame

(BTW, @jason-bowen-zheng and I is think about make this function just like the tkinker's grid function, but it will be a hard time to do it

@shenjackyuanjie
Copy link
Contributor Author

How about implementing this as a subclass of Frame? That way, the spacial hash can be used.

I think for a while
if this is a Frame subclass, It will require a lot of add/remove call each time the on_resize function call
so why not just left this as a single class, or add a adpater for Frame

And now the index is using the hash(obj). so it is ok not to use the spacial hash

@shenjackyuanjie
Copy link
Contributor Author

https://www.bilibili.com/video/BV1aV4y1B7kL
an example for it

@shenjackyuanjie shenjackyuanjie marked this pull request as draft June 5, 2023 16:22
@shenjackyuanjie
Copy link
Contributor Author

So I change it to draft with WIP
let's see if this PR can become better

@shenjackyuanjie shenjackyuanjie changed the title Auto Reposition Frame for #821 [WIP] Auto Reposition Frame for #821 Jun 5, 2023
@shenjackyuanjie
Copy link
Contributor Author

I still think this PR is just an WIP one
just that I'm not sure how to implment it

pyglet/gui/__init__.py Fixed Show fixed Hide fixed
CallBackFunc = Callable[[Repositionable, int, int, Window], None]
CalculateFunc = Callable[[Repositionable, int, int, Window], PotitionTuple]

CallBack = Union[CallBackFunc, CalculateFunc]

Check notice

Code scanning / CodeQL

Unused global variable Note

The global variable 'CallBack' is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants